<?php
require("../conn.php");
$id=$_POST['id'];
$vi_name=$_POST['vi_name'];
$en_name=$_POST['en_name'];
$url=  $_POST['url'];
$order=$_POST['order'];
$parent_id = $_POST["parent_id"];
$featured = (isset($_POST['featured']))? $_POST['featured'] : 0 ;
$sql=sprintf("update tblmenu set url='%s',vi_name = '%s' ,en_name = '%s', tblmenu.order = %s, parent_id = %s, featured= %s where id=%s", $url,$vi_name,$en_name,$order,$parent_id,$featured, $id);
//echo $sql;
$kq=mysql_query($sql)or die(mysql_error());
if(!$kq)
{
?>
	<script language="javascript">
		alert("Sửa menu không thành công!");
		location.href = "../menue?id=<?php echo $id;?>";
	</script>
<?php

}
else
{
?>
	<script language="javascript">
		alert("Sửa menu thành công!");
		location.href = "../menulist";
	</script>
			

<?php
} 
?>		
